import 'package:flutter/material.dart';

class Widget_BaseLine_Page extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text("Baseline"),
        ),
        body: Row(
          children: <Widget>[
            Padding(
              padding: EdgeInsets.only(left: 5.0),
              child: Baseline(
                baseline: 40.0,
                baselineType: TextBaseline.alphabetic,
                child: Text("文本",),
              ),
            ),
            Padding(
              padding: EdgeInsets.only(left: 5.0),
              child: Baseline(
                baseline: 40.0,
                baselineType: TextBaseline.alphabetic,
                child: Text("ajfajf",),
              ),
            ),
            Padding(
              padding: EdgeInsets.only(left: 5.0),
              child: Baseline(
                baseline: 40.0,
                baselineType: TextBaseline.ideographic,
                child: Text("文本",),
              ),
            ),
            Padding(
              padding: EdgeInsets.only(left: 5.0),
              child: Baseline(
                baseline: 40.0,
                baselineType: TextBaseline.ideographic,
                child: Text("ajfajf",),
              ),
            ),
            Padding(
              padding: EdgeInsets.only(left: 5.0),
              child: Baseline(
                baseline: 10.0,
                baselineType: TextBaseline.ideographic,
                child: Text("ajfajf",),
              ),
            ),
            Padding(
              padding: EdgeInsets.only(left: 5.0),
              child: Baseline(
                baseline: 10.0,
                baselineType: TextBaseline.ideographic,
                child: Container(
                  color: Color(0xfff1f1f1),
                  child: Baseline(
                    baseline: 5.0,
                    baselineType: TextBaseline.ideographic,
                    child: Text("ajfajf",),
                  ),
                )
              ),
              ),
          ],
        )
        ,
      ),
    );
  }
}

/**
    const Baseline({
    Key key,
    @required this.baseline,  baseline数值，必须要有，从顶部算
    @required this.baselineType,  alphabetic：对齐字符底部的水平线；  ideographic：对齐表意字符的水平线。
    Widget child
    })
 */
